/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx.oop;

import java.util.Random;

/**
 * <p>Project: jse2303 - C3
 * <p>Powered by webrx On 2023-07-13 15:18:33
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class C3 {

    private int id;
    private String name;

    public C3(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public void C3(int id) {
        this.id = id;
    }

    public C3() {
    }

    public static void main(String[] args) {

        C3 c3 = new C3();
        c3.C3(10);


        //abc();

        System.out.println(getPwd(6));
        System.out.println(getPwd(10));
        System.out.println(getPwd(12));
        System.out.println(getPwd(32));
        System.out.println(getPwd(128));


    }

    public static String getPwd(int len) {
        char[] str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*-=<>/`~?_".toCharArray();
        String password = "";
        Random rand = new Random();
        for (int i = 0; i < len; i++) {
            char c = str[rand.nextInt(str.length)];
            password += String.valueOf(c);
        }
        return password;
    }


    /**
     * void return; return "ok";
     */
    public static void abc() {
        System.out.println("aa");
        System.out.println("bb");
        System.out.println("cc");
        if (Math.random() > .5) {
            //一般出现有返回值，值是相关的返回类型
            //return 16;

            //一般出现在 void方法
            return;
        }
        System.out.println("dd");
        System.out.println("ee");
    }
}
